using System.Collections.Generic;
using System.Threading.Tasks;
using MauiApp.Models;

namespace MauiApp.Services
{
    public interface IApiService
    {
        // 登录相关方法
        Task<LoginResponse?> LoginAsync(MauiApp.Models.LoginRequest request);
        bool IsLoggedIn { get; }
        void Logout();
        Task<bool> TryAutoLoginAsync();
        string GetCurrentUsername();
        string GetCurrentUserId();
        string GetAuthToken();
        
        // 文件相关方法
        Task<FileWithLastTimestampResponse?> GetFileByIdAsync(long fileId);
        Task<List<TypesModel>> GetFileTypesAsync();
        Task<List<TypesModel>> GetFileTypesByUserAsync(string username);
        Task<List<TimeStampModel>> GetFilesAsync();
        Task<List<TimeStampModel>> GetFilesByUserAsync(string username);
        Task<bool> AddFileAsync(TimeStampModel fileInfo);
        Task<bool> AddTimestampAsync(TimeStampModel timeStampModel);
        Task<ReviewInfoResponse?> GetReviewInfoAsync(long fileId);
        Task<bool> AddFileTypeAsync(TypesModel typeModel);
        Task<bool> DeleteFileTypeAsync(int fileTypeId);
        Task<bool> UpdateFileTypeAsync(TypesModel typeModel);
        Task<bool> DeleteFileAsync(int fileId);
        Task<TypesModel?> GetFileTypeByIdAsync(int fileTypeId);
        Task<List<TypesModel>> GetFileTypesByUserIdAsync(int userId);
    }
    
    // 复习信息响应模型
    public class ReviewInfoResponse
    {
        public long FileId { get; set; }
        public string FileName { get; set; } = string.Empty;
        public DateTime LastReviewTime { get; set; }
        public int ReviewCount { get; set; }
     
        public List<TimestampResponse>? Timestamps { get; set; } = new List<TimestampResponse>();
    }
}